#include "Circle.h" // include the Circle's declarations

/*
 * Friends of Circle
 */
Circle operator +(const Circle& aCircle, const Circle& aCircle2) {
	return Circle(aCircle.mRadius+aCircle2.mRadius);
}

Circle operator -(const Circle& aCircle, const Circle& aCircle2) {
	return Circle(aCircle.mRadius-aCircle2.mRadius);
}

bool operator ==(const Circle& aCircle, const Circle& aCircle2) {
	return (aCircle.mRadius == aCircle2.mRadius);
}

// prefix operator
// the pre and postfix operators are denoted by the
// int argument in the postfix declaration
Circle operator ++(Circle& aCircle) {
	// note we return a circle with the
	// radius value incremented
	return Circle(++aCircle.mRadius);
}

// postfix operator circle++
Circle operator ++(Circle& aCircle, int increment) {
	// note we return a circle with the original
	// radius value
	return Circle(aCircle.mRadius++);
}

// we can overload the << output operator
ostream& operator <<(ostream& aOutput, const Circle& aCircle) {
	aOutput << aCircle.mRadius;
	return aOutput;
}

// we can overload the >> output operator
// what does this mean for your object?
istream& operator >>(istream& aInput, Circle& aCircle) {
	aInput >> aCircle.mRadius;
	return aInput;
}

/*
 * Members of a circle
 */
Circle::Circle() {
	mRadius = 1;
}

Circle::Circle(double aRadius) : mRadius(aRadius) {
	if(aRadius <= 0)
		mRadius = 1;
}

double Circle::getRadius() const {
	return mRadius;
}

void Circle::setRadius(double aRadius) {
	mRadius = aRadius;
}

